//
// Created by Aron on 2024/11/2.
//

#include "Door_motor.h"
#include "remote_control.h"
#include "tim.h"
void door_motor_control(void){
    if (rc_ctrl.rc.s[0]==2) {
        if (rc_ctrl.rc.s[1] == 1) {
            __HAL_TIM_SetCompare(&htim1, TIM_CHANNEL_2, 500);
        } else if (rc_ctrl.rc.s[1] == 2) {
            __HAL_TIM_SetCompare(&htim1, TIM_CHANNEL_2, 2500);
        }else if (rc_ctrl.rc.s[1] == 3) {
            __HAL_TIM_SetCompare(&htim1, TIM_CHANNEL_2, 1500);
        }
    }
}